<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Files - YUIDoc</title>
    <link rel="stylesheet" href="https://yui-s.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="icon" href="../assets/favicon.ico">
    <script src="https://yui-s.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script>
</head>
<body class="yui3-skin-sam">

<div id="doc">
    <div id="hd" class="yui3-g header">
        <div class="yui3-u-3-4">
                <h1><img src="../assets/css/logo.png" title="YUIDoc" width="117" height="52"></h1>
        </div>
        <div class="yui3-u-1-4 version">
            <em>API Docs for: 0.10.0</em>
        </div>
    </div>
    <div id="bd" class="yui3-g">

        <div class="yui3-u-1-4">
            <div id="docs-sidebar" class="sidebar apidocs">
                <div id="api-list">
                    <h2 class="off-left">APIs</h2>
                    <div id="api-tabview" class="tabview">
                        <ul class="tabs">
                            <li><a href="#api-classes">Classes</a></li>
                            <li><a href="#api-modules">Modules</a></li>
                        </ul>
                
                        <div id="api-tabview-filter">
                            <input type="search" id="api-filter" placeholder="Type to filter APIs">
                        </div>
                
                        <div id="api-tabview-panel">
                            <ul id="api-classes" class="apis classes">
                                <li><a href="../classes/CLI.html">CLI</a></li>
                                <li><a href="../classes/DocBuilder.html">DocBuilder</a></li>
                                <li><a href="../classes/DocParser.html">DocParser</a></li>
                                <li><a href="../classes/DocView.html">DocView</a></li>
                                <li><a href="../classes/Files.html">Files</a></li>
                                <li><a href="../classes/Help.html">Help</a></li>
                                <li><a href="../classes/Main.html">Main</a></li>
                                <li><a href="../classes/Options.html">Options</a></li>
                                <li><a href="../classes/Server.html">Server</a></li>
                                <li><a href="../classes/Utils.html">Utils</a></li>
                                <li><a href="../classes/YUIDoc.html">YUIDoc</a></li>
                            </ul>
                
                
                            <ul id="api-modules" class="apis modules">
                                <li><a href="../modules/yuidoc.html">yuidoc</a></li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="yui3-u-3-4">
                <div id="api-options">
                    Show:
                    <label for="api-show-inherited">
                        <input type="checkbox" id="api-show-inherited" checked>
                        Inherited
                    </label>
            
                    <label for="api-show-protected">
                        <input type="checkbox" id="api-show-protected">
                        Protected
                    </label>
            
                    <label for="api-show-private">
                        <input type="checkbox" id="api-show-private">
                        Private
                    </label>
                    <label for="api-show-deprecated">
                        <input type="checkbox" id="api-show-deprecated">
                        Deprecated
                    </label>
            
                </div>
            
            <div class="apidocs">
                <div id="docs-main">
                    <div class="content">
<h1>Files Class</h1>
<div class="box meta">


        <div class="foundat">
            Defined in: <a href="../files/lib_files.js.html#l10"><code>lib&#x2F;files.js:10</code></a>
        </div>

            Module: <a href="../modules/yuidoc.html">yuidoc</a>

</div>


<div class="box intro">
    <p>Ported fileutils methods from <a href="http://github.com/rgrove/selleck">Selleck</a></p>

</div>


<div id="classdocs" class="tabview">
    <ul class="api-class-tabs">
        <li class="api-class-tab index"><a href="#index">Index</a></li>

            <li class="api-class-tab methods"><a href="#methods">Methods</a></li>
    </ul>

    <div>
        <div id="index" class="api-class-tabpanel index">
            <h2 class="off-left">Item Index</h2>

                <div class="index-section methods">
                    <h3>Methods</h3>

                    <ul class="index-list methods">
                            <li class="index-item method">
                                <a href="#method_copyAssets">copyAssets</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_copyDirectory">copyDirectory</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_copyFile">copyFile</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_copyPath">copyPath</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_deletePath">deletePath</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_getJSON">getJSON</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_isDirectory">isDirectory</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_isFile">isFile</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_isSymbolicLink">isSymbolicLink</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_lstatSync">lstatSync</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_statSync">statSync</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_writeFile">writeFile</a>

                            </li>
                    </ul>
                </div>



        </div>

            <div id="methods" class="api-class-tabpanel">
                <h2 class="off-left">Methods</h2>

<div id="method_copyAssets" class="method item">
    <h3 class="name"><code>copyAssets</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>from</code>
                </li>
                <li class="arg">
                        <code>dest</code>
                </li>
                <li class="arg">
                        <code>deleteFirst</code>
                </li>
                <li class="arg">
                        <code>callback</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/lib_files.js.html#l369"><code>lib&#x2F;files.js:369</code></a>
        </p>



    </div>

    <div class="description">
        <p>Copy the theme assets directory</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">from</code>
                        <span class="type"><a href="http://yuilibrary.com/yui/docs/api/classes/Path.html" class="crosslink external" target="_blank">Path</a></span>


                    <div class="param-description">
                        <p>The source directory</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">dest</code>
                        <span class="type"><a href="http://yuilibrary.com/yui/docs/api/classes/Path.html" class="crosslink external" target="_blank">Path</a></span>


                    <div class="param-description">
                        <p>The destination directory</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">deleteFirst</code>
                        <span class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>


                    <div class="param-description">
                        <p>Should the directory be deleted if it exists</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">callback</code>
                        <span class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function" class="crosslink external" target="_blank">Function</a></span>


                    <div class="param-description">
                        <p>The callback to be executed</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_copyDirectory" class="method item">
    <h3 class="name"><code>copyDirectory</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>source</code>
                </li>
                <li class="arg">
                        <code>dest</code>
                </li>
                <li class="arg">
                        <code class="optional">[overwrite=false]</code>
                </li>
                <li class="arg">
                        <code>callback</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/lib_files.js.html#l39"><code>lib&#x2F;files.js:39</code></a>
        </p>



    </div>

    <div class="description">
        <p>Copy a directory from one location to another</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">source</code>
                        <span class="type"><a href="http://yuilibrary.com/yui/docs/api/classes/Path.html" class="crosslink external" target="_blank">Path</a></span>


                    <div class="param-description">
                        <p>The source directory</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">dest</code>
                        <span class="type"><a href="http://yuilibrary.com/yui/docs/api/classes/Path.html" class="crosslink external" target="_blank">Path</a></span>


                    <div class="param-description">
                        <p>The destination directory</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name optional">[overwrite=false]</code>
                        <span class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
                        <span class="flag optional" title="This parameter is optional.">optional</span>


                    <div class="param-description">
                        <p>Whether or not to overwrite destination files
if they already exist.</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">callback</code>
                        <span class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function" class="crosslink external" target="_blank">Function</a></span>


                    <div class="param-description">
                        <p>The callback to be executed when complete.</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_copyFile" class="method item">
    <h3 class="name"><code>copyFile</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>source</code>
                </li>
                <li class="arg">
                        <code>dest</code>
                </li>
                <li class="arg">
                        <code class="optional">[overwrite=false]</code>
                </li>
                <li class="arg">
                        <code>callback</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/lib_files.js.html#l128"><code>lib&#x2F;files.js:128</code></a>
        </p>



    </div>

    <div class="description">
        <p>Copy a file from one location to another</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">source</code>
                        <span class="type"><a href="http://yuilibrary.com/yui/docs/api/classes/Path.html" class="crosslink external" target="_blank">Path</a></span>


                    <div class="param-description">
                        <p>The source file</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">dest</code>
                        <span class="type"><a href="http://yuilibrary.com/yui/docs/api/classes/Path.html" class="crosslink external" target="_blank">Path</a></span>


                    <div class="param-description">
                        <p>The destination file</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name optional">[overwrite=false]</code>
                        <span class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
                        <span class="flag optional" title="This parameter is optional.">optional</span>


                    <div class="param-description">
                        <p>Whether or not to overwrite destination files
if they already exist.</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">callback</code>
                        <span class="type">Callback</span>


                    <div class="param-description">
                        <p>The callback to be executed when complete.</p>

                    </div>

                        <ul class="params-list">
                            <li class="param">
                                    <code class="param-name">err</code>
                                    <span class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error" class="crosslink external" target="_blank">Error</a></span>

                                <div class="param-description">
                                    <p>The Error returned from Node</p>

                                </div>

                            </li>
                        </ul>
                </li>
            </ul>
        </div>



</div>
<div id="method_copyPath" class="method item">
    <h3 class="name"><code>copyPath</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>source</code>
                </li>
                <li class="arg">
                        <code>dest</code>
                </li>
                <li class="arg">
                        <code class="optional">[overwrite=false]</code>
                </li>
                <li class="arg">
                        <code>callback</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/lib_files.js.html#l181"><code>lib&#x2F;files.js:181</code></a>
        </p>



    </div>

    <div class="description">
        <p>If <em>source</em> is a file, copies it to <em>dest</em>. If it's a directory, recursively
copies it and all files and directories it contains to <em>dest</em>.</p>
<p>Note that when attempting to copy a file into a directory, you should specify
the full path to the new file (including the new filename). Otherwise, it will
be interpreted as an attempt to copy the <em>source</em> file <em>over</em> the <em>dest</em>
directory instead of <em>into</em> it.</p>
<p>Known issues:</p>
<ul>
<li>Doesn't preserve ownership or permissions on copied files/directories.</li>
</ul>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">source</code>
                        <span class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>


                    <div class="param-description">
                        <p>Source path.</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">dest</code>
                        <span class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>


                    <div class="param-description">
                        <p>Destination path.</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name optional">[overwrite=false]</code>
                        <span class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
                        <span class="flag optional" title="This parameter is optional.">optional</span>


                    <div class="param-description">
                        <p>Whether or not to overwrite destination files
if they already exist.</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">callback</code>
                        <span class="type">Callback</span>


                    <div class="param-description">
                        <p>The callback to execute when completed.</p>

                    </div>

                        <ul class="params-list">
                            <li class="param">
                                    <code class="param-name">err</code>
                                    <span class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error" class="crosslink external" target="_blank">Error</a></span>

                                <div class="param-description">
                                    
                                </div>

                            </li>
                        </ul>
                </li>
            </ul>
        </div>



</div>
<div id="method_deletePath" class="method item">
    <h3 class="name"><code>deletePath</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>path</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/lib_files.js.html#l227"><code>lib&#x2F;files.js:227</code></a>
        </p>



    </div>

    <div class="description">
        <p>If <em>path</em> is a file, deletes it. If <em>path</em> is a directory, recursively deletes
it and all files and directories it contains.</p>
<p>This method is synchronous.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">path</code>
                        <span class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>


                    <div class="param-description">
                        <p>File or directory to delete.</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_getJSON" class="method item">
    <h3 class="name"><code>getJSON</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>filename</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="crosslink external external" target="_blank">Object</a></span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/lib_files.js.html#l417"><code>lib&#x2F;files.js:417</code></a>
        </p>



    </div>

    <div class="description">
        <p>Helper method for getting JSON data from a local file</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">filename</code>
                        <span class="type"><a href="http://yuilibrary.com/yui/docs/api/classes/Path.html" class="crosslink external" target="_blank">Path</a></span>


                    <div class="param-description">
                        <p>The filename to parse JSON from</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object" class="crosslink external external" target="_blank">Object</a></span>:
                    <p>The JSON data</p>

            </div>
        </div>


</div>
<div id="method_isDirectory" class="method item">
    <h3 class="name"><code>isDirectory</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>path</code>
                </li>
                <li class="arg">
                        <code class="optional">[link=false]</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/lib_files.js.html#l252"><code>lib&#x2F;files.js:252</code></a>
        </p>



    </div>

    <div class="description">
        <p>Check to see if this is a directory</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">path</code>
                        <span class="type"><a href="http://yuilibrary.com/yui/docs/api/classes/Path.html" class="crosslink external" target="_blank">Path</a></span>


                    <div class="param-description">
                        <p>The path to check</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name optional">[link=false]</code>
                        <span class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
                        <span class="flag optional" title="This parameter is optional.">optional</span>


                    <div class="param-description">
                        <p>Also validate a symlink</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>:
                    <p>True if it is a directory</p>

            </div>
        </div>


</div>
<div id="method_isFile" class="method item">
    <h3 class="name"><code>isFile</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>path</code>
                </li>
                <li class="arg">
                        <code class="optional">[link=false]</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/lib_files.js.html#l283"><code>lib&#x2F;files.js:283</code></a>
        </p>



    </div>

    <div class="description">
        <p>Check to see if this is a File</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">path</code>
                        <span class="type"><a href="http://yuilibrary.com/yui/docs/api/classes/Path.html" class="crosslink external" target="_blank">Path</a></span>


                    <div class="param-description">
                        <p>The path to check</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name optional">[link=false]</code>
                        <span class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
                        <span class="flag optional" title="This parameter is optional.">optional</span>


                    <div class="param-description">
                        <p>Also validate a symlink</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>:
                    <p>True if it is a file</p>

            </div>
        </div>


</div>
<div id="method_isSymbolicLink" class="method item">
    <h3 class="name"><code>isSymbolicLink</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>path</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/lib_files.js.html#l312"><code>lib&#x2F;files.js:312</code></a>
        </p>



    </div>

    <div class="description">
        <p>Check to see if this is a SymLink</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">path</code>
                        <span class="type"><a href="http://yuilibrary.com/yui/docs/api/classes/Path.html" class="crosslink external" target="_blank">Path</a></span>


                    <div class="param-description">
                        <p>The path to check</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>:
                    <p>True if it is a link</p>

            </div>
        </div>


</div>
<div id="method_lstatSync" class="method item">
    <h3 class="name"><code>lstatSync</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>path</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">fs.Stats | Null</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/lib_files.js.html#l326"><code>lib&#x2F;files.js:326</code></a>
        </p>



    </div>

    <div class="description">
        <p>Like <code>fs.lstatSync()</code>, but returns <code>null</code> instead of throwing when <em>path</em>
doesn't exist. Will still throw on other types of errors.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">path</code>
                        <span class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>


                    <div class="param-description">
                        <p>Path to stat.</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">fs.Stats | Null</span>:
                    <p><code>fs.Stats</code> object, or <code>null</code> if <em>path</em> doesn't exist.</p>

            </div>
        </div>


</div>
<div id="method_statSync" class="method item">
    <h3 class="name"><code>statSync</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>path</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">fs.Stats | Null</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/lib_files.js.html#l348"><code>lib&#x2F;files.js:348</code></a>
        </p>



    </div>

    <div class="description">
        <p>Like <code>fs.statSync()</code>, but returns <code>null</code> instead of throwing when <em>path</em>
doesn't exist. Will still throw on other types of errors.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">path</code>
                        <span class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>


                    <div class="param-description">
                        <p>Path to stat.</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">fs.Stats | Null</span>:
                    <p><code>fs.Stats</code> object, or <code>null</code> if <em>path</em> doesn't exist.</p>

            </div>
        </div>


</div>
<div id="method_writeFile" class="method item">
    <h3 class="name"><code>writeFile</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>file</code>
                </li>
                <li class="arg">
                        <code>data</code>
                </li>
                <li class="arg">
                        <code>callback</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/lib_files.js.html#l432"><code>lib&#x2F;files.js:432</code></a>
        </p>



    </div>

    <div class="description">
        <p>Helper method for writing files to disk. It wraps the NodeJS file API</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">file</code>
                        <span class="type"><a href="http://yuilibrary.com/yui/docs/api/classes/Path.html" class="crosslink external" target="_blank">Path</a></span>


                    <div class="param-description">
                        <p>The filename to write to</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">data</code>
                        <span class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>


                    <div class="param-description">
                        <p>The data to write</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">callback</code>
                        <span class="type">Callback</span>

                        <span class="flag multiple" title="This argument may occur one or more times.">multiple</span>

                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>



</div>
            </div>



    </div>
</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../assets/../api.js"></script>
<script src="../assets/js/api-filter.js"></script>
<script src="../assets/js/api-list.js"></script>
<script src="../assets/js/api-search.js"></script>
<script src="../assets/js/apidocs.js"></script>
</body>
</html>
